<?php

namespace app\common\model;

use think\Db;
use think\Model;

class GBillModel extends Model
{
    protected $name = 'user_gbill';
    // 开启自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';
    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = '';
    // 追加属性
    protected $append = [
    ];

    public function gongxianU($nums,$user_id,$title){
        $this->save([
            'nums'=>$nums,
            'user_id'=>$user_id,
            'title'=>$title
        ]);
        Db::name('user')->where('id',$user_id)->inc('scoreg',$nums)->update();
    }

}